//===- HWArithTypes.cpp - Implement the HW arithmetic types ..-------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implement the HW arithmetic data types.
//
//===----------------------------------------------------------------------===//

#include "circt/Dialect/HWArith/HWArithTypes.h"
#include "mlir/IR/BuiltinOps.h"

using namespace circt;
using namespace hwarith;

bool circt::hwarith::isHWArithIntegerType(Type type) {
  return isa<IntegerType>(type) && !type.isSignlessInteger() &&
         type.getIntOrFloatBitWidth() > 0;
}

//===----------------------------------------------------------------------===//
// TableGen generated logic.
//===----------------------------------------------------------------------===//

// Provide the autogenerated implementation guts for the type classes.
#define GET_TYPEDEF_CLASSES
#include "circt/Dialect/HWArith/HWArithTypes.cpp.inc"
